FROM docker.m.daocloud.io/node:20.9.0 AS builder
WORKDIR /app

# Copy source code
COPY . .

FROM docker.m.daocloud.io/nginx:latest
COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint2.sh 
COPY --from=builder /app/nginx.conf.template /
COPY --from=builder /app/apps/web/build /usr/share/nginx/html
ENTRYPOINT ["sh", "/docker-entrypoint2.sh"]
CMD ["nginx","-g","daemon off;"]